package com.fengquan;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * Created by IntelliJ IDEA.
 * User: com.fengquan
 * Date: 2020/5/9
 * Time: 12:16
 * SpringBoot启动类
 */
@SpringBootApplication
@EnableScheduling
@EnableAsync//开启异步任务
@MapperScan("com.fengquan.*.mapper")
@PropertySource("classpath:application.properties")//制定配置文件
public class App extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        //这里的HelloApplication是SpringBoot的启动类
        return builder.sources(App.class);
    }

    public static void main(String [] args){
        SpringApplication.run(App.class, args);
    }

}
